package com.wangdao.wechatmall.controller.wx;

import com.wangdao.wechatmall.bean.vo.admin.BaseRespVo;
import com.wangdao.wechatmall.bean.vo.wx.WXProvinceListVO;
import com.wangdao.wechatmall.service.admin.RegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * WxRegionController
 * created by feng on 7/11/21
 */
@RestController
@RequestMapping("wx/region")
public class WXRegionController {

    @Autowired
    RegionService regionService;

    //http://182.92.235.201:8083/wx/region/list?pid=32
    @GetMapping("list")
    public BaseRespVo list(@RequestParam("pid") Integer pid) {

        List<WXProvinceListVO> wxProvinceList = regionService.getProvinceListByPid(pid);
        return BaseRespVo.ok(wxProvinceList);
    }


}